//删除所有路点，然后来回移动
params ["_group", "_pos2"];

//删除所有路点
while {(count (waypoints _group)) > 0} do
{
	deleteWaypoint ((waypoints _group) select 0);
};

private _pos = getPos leader _group;

//0移动，出发点
//1移动，目标点
//2循环，出发点
_group addWaypoint [_pos, 20, 0];
[_group, 0] setWaypointType "MOVE";

_group addWaypoint [_pos2, 20, 1];
[_group, 1] setWaypointType "MOVE";

_group addWaypoint [_pos, 20, 2];
[_group, 2] setWaypointType "CYCLE";

if(Param_Debug == 1) then
{
	private _marker = createMarker [format["marker_wp_%1", as_waypoint_cur], _pos];
	_marker setMarkerShape "ICON";
	_marker setMarkerColor "ColorRed";
	_marker setMarkerType "mil_arrow";
	_marker setMarkerText "周期Start";
	as_waypoint_cur = as_waypoint_cur + 1;
	
	_marker = createMarker [format["marker_wp_%1", as_waypoint_cur], _pos2];
	_marker setMarkerShape "ICON";
	_marker setMarkerColor "ColorRed";
	_marker setMarkerType "mil_arrow";
	_marker setMarkerText "周期End";
	as_waypoint_cur = as_waypoint_cur + 1;
};